angular.module("module.noticeList",[])
    .config(['$stateProvider',function ($stateProvider) {
        $stateProvider
            .state('home.noticeList',{
                url:"/noticeList",
                templateUrl:"noticeList/noticeList.html",
                controller:'NoticeListController',
                controllerAs:'vm'
            })
    }])
    .controller('NoticeListController',[function () {
        var vm=this;
        $('.xiaoxi').html(template('xiaoxi_tmpl', data));
        $('.xiaoxi tr').on('click', function() {
            var i = $(this).attr('data-i');
            var vo = data.dataList[i];
            var readObj = $(this).find('.circle');
            if (readObj.length>0){
                $.getJSON('noticeRead', {id:vo.id});
                readObj.remove();
            }
            winAlert({title:vo.title, body:template('cont_tmpl', vo)});
            return false;
        })
    }]);